import React, { Component } from 'react'
//高阶组件
function high(Com) {
    return class NewCom extends Component {
        state = {
            num: 123
        }
        add = () => {
            this.setState({ num: this.state.num + 1 })
        }
        render() {
            const { num } = this.state
            return (
                <div>
                    <Com num={num} add={this.add} />
                </div>
            )
        }
    }

}
export { high }
